#ifndef _TIMCCFUNC_INCLUDED_
#define _TIMCCFUNC_INCLUDED_

#include <stm32f4xx.h>

// TIM_SetCompareX, TIM_GetCaptureX
typedef void (*pTIMCompareFunc) (TIM_TypeDef*, uint32_t);
typedef uint32_t (*pTIMCaptureFunc) (TIM_TypeDef*);

constexpr pTIMCompareFunc TIMCompareFuncList[4] =
{TIM_SetCompare1, TIM_SetCompare2, TIM_SetCompare3, TIM_SetCompare4};
constexpr pTIMCaptureFunc TIMCaptureFuncList[4] =
{TIM_GetCapture1, TIM_GetCapture2, TIM_GetCapture3, TIM_GetCapture4};

// TIM_OCxInit, TIM_OCxPreloadConfig
typedef void (*pTIMOCInit) (TIM_TypeDef*, TIM_OCInitTypeDef *);
typedef void (*pTIMOCPreloadConfig) (TIM_TypeDef*, uint16_t);

constexpr pTIMOCInit TIMOCInitList[4] =
{TIM_OC1Init, TIM_OC2Init, TIM_OC3Init, TIM_OC4Init};
constexpr pTIMOCPreloadConfig TIMOCPreloadConfigList[4] =
{TIM_OC1PreloadConfig, TIM_OC2PreloadConfig, TIM_OC3PreloadConfig, TIM_OC4PreloadConfig};

#endif
